package com.ecnu.system.domain.dto;

import lombok.Data;

import javax.validation.constraints.AssertTrue;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Data
public class UpdatePwdDTO {
    @NotBlank(message = "邮箱不能为空")
    @Email(regexp = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$",
            message = "邮箱格式不正确")
    @Size(max = 254, message = "邮箱长度不能超过254个字符")
    private String email;

    @NotBlank(message = "验证码不能为空")
    private String code;

//    @NotBlank(message = "密码不能为空")
//    private String password;
//
//    @NotBlank(message = "确认密码不能为空")
//    private String secPassword;
//    @AssertTrue(message = "密码与确认密码不一致，请重新输入")
//    public boolean isRegistrationTimeValid() {
//        if (!password.equals(secPassword)) {
//            return false;
//        }
//        return true;
//    }
}
